<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<!-- 最新 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="http://cdn.bootcss.com/twitter-bootstrap/3.0.3/css/bootstrap.min.css">
<!-- 可选的Bootstrap主题文件（一般不用引入） -->
<link rel="stylesheet" href="http://cdn.bootcss.com/twitter-bootstrap/3.0.3/css/bootstrap-theme.min.css">
<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="http://cdn.bootcss.com/jquery/1.10.2/jquery.min.js"></script>
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="http://cdn.bootcss.com/twitter-bootstrap/3.0.3/js/bootstrap.min.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>ADMIN条件查询，分页</title>
<script type="text/javascript">
	function nextPage() {
		form = document.getElementById("listForm");
		pageNoInput = document.getElementById("pageNo");
		pageNo = parseInt(pageNoInput.value);
		pageNoInput.value = pageNo + 1;
		form.submit();
	}
	function prePage() {
		form = document.getElementById("listForm");
		pageNoInput = document.getElementById("pageNo");
		pageNo = parseInt(pageNoInput.value);
		pageNoInput.value = pageNo - 1;
		form.submit();
	}
	function firstPage() {
		form = document.getElementById("listForm");
		document.getElementById("pageNo").value=1;
		form.submit();
	}
	function lastPage() {
		form = document.getElementById("listForm");
		document.getElementById("pageNo").value=${page.totalPage};
		form.submit();
	}
</script>
</head>
<body>
<form id="listForm" action="list.do" method="post">
	课程名称<input name="courseName" value=""/>
	任课教师<input name="courseName" value=""/>
	上课时间在<input name="courseName" value=""/>
	到<input name="courseName" value=""/>
	<input type="submit" value="查询"/>
	<c:if test="${empty msg}">
		<table>
			<tr>
				<td>序号</td>
				<td>名称</td>
				<td>任课教师</td>
				<td>上课时间</td>
				<td>上课地点</td>
				<td>课容量</td>
				<td>开始选课时间</td>
				<td>结束选课时间</td>
				<td>操作</td>
			</tr>
		<c:forEach items="voList" var="vo" varStatus="s">
			<tr>
				<td>${s.index+1}</td>
				<td>${vo.courseName}</td>
				<td>${vo.teacher}</td>
				<td>${vo.teachTime}</td>
				<td>${vo.teachPlace}</td>
				<td>${vo.courseVolume}</td>
				<td>${vo.startTime}</td>
				<td>$${vo.endTime}</td>
				<td>编辑 删除 导出签到表</td>
			</tr>
		</c:forEach>
		</table>
		<br>
		第${page.pageNo}页/共${page.totalPage}页
		第${page.firstResultNum+1}条记录到第${page.lastResultNum}条记录/共${page.totalQuantity}条记录
		<c:if test="${!page.firstPage}">
		<a href="#" onclick="firstPage();">首页</a>
		<a href="#" onclick="prePage();">上页</a>
		</c:if>
		<c:if test="${!page.lastPage}">
		<a href="#" onclick="nextPage();">下页</a>
		<a href="#" onclick="lastPage();">尾页</a>
		</c:if>
	</c:if>
	
	<c:if test="${!empty msg}">
		${msg}
	</c:if>
	
</form>

</body>
</html>